Class sjl.Queue
All Packages Class Hierarchy This Package Previous Next Index
Class sjl.Queue
java.lang.Object
|
+----sjl.Queue
- public class Queue
- extends Object
Queue
is a container adapter that provides a
first-in, first-out protocol to the elements in the
container. The container must implement the
QueueContainer interface.
The List
and Deque
containers implements
the QueueContainer
interface.
Copyright © 1996 Finn Bock
- See Also:
- List, Deque
-
Queue(QueueContainer)
- Construct a new Queue based on the container argument.
-
back()
- Return the last element of the Queue.
-
empty()
- Returns
true
if the queue does not contain any elements.
-
equals(Object)
- Compare the elements in this container with the elements
in another container.
-
front()
- Return the first element of the Queue.
-
pop()
- Returns and removes the top element on the queue.
-
push(Object)
- Insert a new element on the top of the Queue..
-
size()
- Returns the number of elements stored in the vector.
Queue
public Queue(QueueContainer container)
- Construct a new Queue based on the container argument.
equals
public boolean equals(Object container)
- Compare the elements in this container with the elements
in another container.
- Returns:
-
true
is the elements match.
- Overrides:
- equals in class Object
size
public int size()
- Returns the number of elements stored in the vector.
empty
public boolean empty()
- Returns
true
if the queue does not contain any elements.
pop
public void pop()
- Returns and removes the top element on the queue.
push
public void push(Object o)
- Insert a new element on the top of the Queue..
front
public Object front()
- Return the first element of the Queue. Undefined if the queue is empty.
back
public Object back()
- Return the last element of the Queue. Undefined if the queue is empty.
All Packages Class Hierarchy This Package Previous Next Index